pub mod v1 {
    use arbitrum_light_client_types::{ClientStateV1, HeaderV1};
    use arbitrum_types::v1;
    use evm_storage_verifier::{verify_account_storage_root, verify_storage_proof};
    use unionlabs::primitives::{H256, U256};

    #[derive(Debug, PartialEq, Clone, thiserror::Error)]
    pub enum Error {
        #[error("invalid l1 contract address proof")]
        InvalidL1ContractAddressProof(#[source] evm_storage_verifier::error::Error),
        #[error("invalid _latestConfirmed proof")]
        InvalidNextNodeNumSlotProof(#[source] evm_storage_verifier::error::Error),
        #[error("invalid _nodes[_latestConfirmed].confirmData proof")]
        InvalidNodeConfirmDataProof(#[source] evm_storage_verifier::error::Error),
        #[error("invalid L2 proof")]
        InvalidL2Proof(#[source] evm_storage_verifier::error::Error),
    }

    /// Verify the provided header against the provided client state and L1 state root.
    ///
    /// Header verification for arbitrum consists of 4 steps:
    ///
    /// 1. Verify that the L1 `RollupCore` account root is part of the L1 state root.
    /// 2. Verify that the value stored at `L1_LATEST_NODE_CREATED_SLOT` is part of the L1
    ///    `RollupCore` account root
    /// 3. Verify that the confirm data stored in the `Node` struct at the `_nodes` mapping indexed by
    ///    the node number verified in 2. matches the
    ///    [`L2Header::confirm_data_hash`](arbitrum_light_client_types::L2Header::confirm_data_hash).
    /// 4. Verify that the `IBCHandler` account root is part of the L2 state root (which is contained in
    ///    the header verified in 3.).
    pub fn verify_header(
        client_state: &ClientStateV1,
        header: &HeaderV1,
        l1_state_root: H256,
    ) -> Result<(), Error> {
        // 1.
        verify_account_storage_root(
            l1_state_root,
            &client_state.l1_contract_address,
            &header.l1_account_proof.proof,
            &header.l1_account_proof.storage_root,
        )
        .map_err(Error::InvalidL1ContractAddressProof)?;

        // 2.
        verify_storage_proof(
            header.l1_account_proof.storage_root,
            v1::ROLLUP_CORE_LATEST_NODE_CREATED.slot(),
            &rlp::encode(&header.l1_next_node_num_slot_proof.value),
            &header.l1_next_node_num_slot_proof.proof,
        )
        .map_err(Error::InvalidNextNodeNumSlotProof)?;

        // the .value is verified by the proof above
        let node_num = v1::read_latest_node_created(header.l1_next_node_num_slot_proof.value);

        // 3.
        verify_storage_proof(
            header.l1_account_proof.storage_root,
            v1::rollup_core_nodes_confirm_data_slot(node_num),
            &rlp::encode(&U256::from_be_bytes(
                // TODO: Find where this value is calculated as the confirmData and link it
                *header.l2_header.confirm_data_hash().get(),
            )),
            &header.l1_nodes_slot_proof.proof,
        )
        .map_err(Error::InvalidNodeConfirmDataProof)?;

        // 4.
        verify_account_storage_root(
            header.l2_header.state_root,
            &client_state.ibc_contract_address,
            &header.l2_ibc_account_proof.proof,
            &header.l2_ibc_account_proof.storage_root,
        )
        .map_err(Error::InvalidL2Proof)?;

        Ok(())
    }
}

pub mod v2 {
    use arbitrum_light_client_types::{client_state::ClientStateV2, header::HeaderV2};
    use arbitrum_types::v2::{
        ASSERTION_NODE_STATUS_BYTE_OFFSET, assertion_hash, rollup_core_assertions_slot,
    };
    use evm_storage_verifier::{verify_account_storage_root, verify_storage_proof};
    use unionlabs::{ensure, primitives::H256};

    /// Verify the provided header against the provided client state and L1 state root.
    ///
    /// Header verification for arbitrum consists of 4 steps:
    ///
    /// 1. Verify that the L1 `RollupCore` account root is part of the L1 state root.
    /// 2. Verify that the L2 header matches the assertion state.
    /// 3. Verify the `_assertions` proof in the `RollupCore` state.
    /// 4. Verify that the stored assertion's state is > 0 (i.e. that it exists).
    /// 5. Verify that the `IBCHandler` account root is part of the L2 state root (which is contained in
    ///    the header verified in 2.).
    pub fn verify_header(
        client_state: &ClientStateV2,
        header: &HeaderV2,
        l1_state_root: H256,
    ) -> Result<(), Error> {
        // 1.
        verify_account_storage_root(
            l1_state_root,
            &client_state.l1_contract_address,
            &header.l1_account_proof.proof,
            &header.l1_account_proof.storage_root,
        )
        .map_err(Error::InvalidL1ContractAddressProof)?;

        // 2.
        ensure(
            header.assertion_state.global_state.bytes32_vals[0] == header.l2_header.hash(),
            Error::InvalidL2Header,
        )?;

        // 3.
        verify_storage_proof(
            header.l1_account_proof.storage_root,
            rollup_core_assertions_slot(assertion_hash(
                header.parent_assertion_hash,
                header.assertion_state.hash(),
                header.inbox_acc,
            )),
            &rlp::encode(&header.l1_assertions_proof.value),
            &header.l1_assertions_proof.proof,
        )
        .map_err(Error::InvalidAssertionsProof)?;

        // 4.
        ensure(
            header.l1_assertions_proof.value.to_be_bytes()[ASSERTION_NODE_STATUS_BYTE_OFFSET] > 0,
            Error::InvalidAssertionStatus,
        )?;

        // 5.
        verify_account_storage_root(
            header.l2_header.state_root,
            &client_state.ibc_contract_address,
            &header.l2_ibc_account_proof.proof,
            &header.l2_ibc_account_proof.storage_root,
        )
        .map_err(Error::InvalidL2Proof)?;

        Ok(())
    }

    #[derive(Debug, PartialEq, Clone, thiserror::Error)]
    pub enum Error {
        #[error("invalid l1 contract address proof")]
        InvalidL1ContractAddressProof(#[source] evm_storage_verifier::error::Error),
        #[error("invalid _latestConfirmed proof")]
        InvalidNextNodeNumSlotProof(#[source] evm_storage_verifier::error::Error),
        #[error("invalid _nodes[_latestConfirmed].confirmData proof")]
        InvalidAssertionsProof(#[source] evm_storage_verifier::error::Error),
        #[error("invalid L2 proof")]
        InvalidL2Proof(#[source] evm_storage_verifier::error::Error),
        #[error("invalid L2 header")]
        InvalidL2Header,
        #[error("invalid assertion status")]
        InvalidAssertionStatus,
    }
}

#[cfg(test)]
mod tests {
    use arbitrum_light_client_types::{ClientState, ClientStateV2, HeaderV1, HeaderV2};
    use ethereum_light_client_types::{AccountProof, StorageProof};
    use hex_literal::hex;
    use ibc_union_spec::ClientId;
    use unionlabs::{
        encoding::{Bincode, DecodeAs},
        ibc::core::client::height::Height,
        primitives::{Bytes, U256},
    };

    use super::*;

    #[test]
    fn full_finality_state_to_partial_finality_state_v1() {
        let header = HeaderV1::decode_as::<Bincode>(&"0x00329c5301000000001de7a7a170e3eb7041c47a8b99c1bf5de9ac91318adeaceba74f07879dab42c208000000000000001402000000000000f90211a0b22412d7b6a4c2de6d29cecb7a5283f8d0371584aad04799f16ca5aab0f92b38a0c02bf12e5b1d40b44df9d972f4da09828732d158428af24ae73881a1d618d8ada04fff7340e7578c6280546f43a0a9ad63e2c5f04774ed8ede990f9341a4527f79a0c52a762f14bbd76db6a7557e4d1ffc8d6012e8625d4e82fad208393c7313e140a0fcf81dddc92e124cec95d49135ec33cee84bec8436c9c768772205d6900b62c2a0f5dfd380ee86da93610831c2c1bf516b77b678a64fcc57d3df320b84739c0df0a01136184c50b90095235c80d3cdb3a75dfc7c7da64f4bd6095342ee57ac88a094a0f2457cbb49b727a186ba7068c148815452d7ba7a9c8916d0ebc51e1f194ba3cba0acac88d5aefd467e5d928562887a6e0388a9c82438d445b9f94ee0896ed77338a074434761df0c5f88a6e3b0abb9f07315573ec2369e759d4ee6a9157c919c30dda041b151a2292f5363112966b58cf7a43f639cc139c22a886dfa1bedda793e34ada05c1e46d833940668085b9e893aff157682fdeb1d3aef2ab8f2117fb1415c1beaa056a615de594b6427838f71aa0ee4415507921dc92411cd6f2925e975b9772b7fa06792c2ec82731a9edb4e1486afc20e7b140c0dd1e48ae087a81686d748acea2ca03a4a7b5c03355701b5e8eddfffacca915c1ab2862cbd384835ef0fc870c52639a0e2565589e8ab9c98072c714418180f283e4a0612a746548ec352aaca46333ffd801402000000000000f90211a0c6ec4a0386da0cd9b97c56a506195b4834d176930386e32d5df52a1433b1aabba0b6bd251c5963427f11afc07b357c132b5017e0583553f179c25cb973aad5c50fa07436f76b4409e889c48216843dc0529580fc8d5f64e1090c1e545c193015f664a00df5ef4ceee96c6636f9228792bdb6ad20bcf20152cc00fda9c4f110c4600113a08ac345057ada25695908b8afb634249aec72e5ed91856c31a422dbc6b2f796e0a0f39607bdd3f2f9567c93a378b75489d851a8c196f97cb4725dca8e587031323fa09e3110a90e2901dc413ae3172768d7d5bf20cf9256e40396ec91bc38921187dda08673bc8da84ef620945362a00fd88dd9949e6932d6d9c25b3dda6c26ccb88abca0a79b589c40ea2c2d5a636771cc1091c32d1fe5f09862459d9c831e5c9d05157ba036dfd53ad27c8502304a72860dc80f5b088dc3f8958abbceff0f45cf563897b3a0c20b1667ed444689c9992081028aa5d137bbd6476c06d0215cf9ce10b22e3c4da008af517095a2f1963a23f954405f019180cc4b3d7f77e99107649ba9feff1edfa02148a7bdcbbabfd03f2e936a70d0d1a023f6ac9c14ab654c1cf3172499b9e753a029b0c00b7fed20c748e1311c958d885615f2314efc2bf2ab2463f85652144ff5a06a93f0788f9ad2952da2f36f598bd52ac1badc85475836d9ab279ca3e4555816a02e4616c3c0f3a4b87d4e54b755b2460dc86efff5f8be211369677d208015db7c801402000000000000f90211a011b662beea94ef97336dcd7581b9ebd61071765227a52830db3134f8e6d2059da0f00c661c4225f5200db6e9dfed1714e3b127e3f71c0edd6c53cfd4be9e7dbc8ca00294e1e95f6f29f94f4c5e6cb8567e6daabf5adea96c3d67233e1f0086f2ae36a0a3c4d823b00cc3890ef401c0f32e8be706d9b94fb04fbfdce7787876c135a8bca0afdc0af38fceb51fd06c9ed9375c6cae12d5da97c0cc80418a9c9093f39d97fca08c015b8fc17350732b308ef1a475189ea2213e68a5d56f3786b2a665d19929b1a0b1b83b713396b31b7d916cd84064b9264a3561f9eba57d01c61019165dbb3f14a0d41710bb817f898b383a871aec6adc37d0645a3772d58cd91a0bbf4bbb24a022a0bea925d6fc4c30ddf34ce0e39d078eb19de94cd779708e82dd5ed52c8063f060a08233971fbca33b034efe89c21c885f7b2cc2c565403c2908b412161b7417580fa055d4701fc1b9521cdca00d450a4753e9db29f75949c55b4b7ffe56e43401d768a0ac59c8745927e46e727a421d4e9a8dc3ffce5862eb36f0f7788a9dcd5853c953a0e04bc85ca9f2e0b48f97ce6bc7391e3b343f042d3a3de2992c34510c5906ebd5a089abc8a3234ee49577d052cca6f3a0c238fb55275a11138e3aa95e874aec0c90a0e2dd3c8303a1afc4d49c776cebd4d3789e330038eb5184df3acb91b46b48e7d2a066d1151a4afe1787f18b63c5e1e9d4ea725a0384609f697f620de76c17434d56801402000000000000f90211a05f8d700a40bcdfb325a8fdb1df5ede55a674c0b851a3dba5fefc34ddfd0996cfa0b46bdd7b4f01ab3c7d24dc2731467c4bd8efb3dc8345588883f63f22de92679ba0571708b013759ac9b1d40af92befb3f690d187e1d01dc83e2410c8138185adf6a0005569818b4d2193f371ff8dae78ffffc6c4cf53de8829192da2e076ee72627fa008e154bab9cb13d43e10f71bfbb117e42b9223a2c3160781b82508138deee320a0483957f316c889d4cc69390253f62675c4ddd8f98eb6824a3ce73c4fb396a363a0e773ad76a02ea02c20d914ff6f1a702a497073acd51a2a18e110f09a96edf658a0e4298adca5633ab48deac0cde3d7d67565705c4711e4b0dde481556406207ea4a053462fc0313db975e030d13dbc35a270ece3b09c4e2e951faf7304f218a910c6a0e75a29360889681fe2229ec032b51b898b1dd048977f5bf2be5dd43c27a264e1a0c90310d6319fca2f1a6f1e651a3ad7021bbe034df5c235237d481c2a78d5c7a1a0a9f3547d2d88e42fd53e1470f775d9d719594ed427e92fcca7278ed976b7f7a6a0f52963ac3a990cafd7d946b787e8bcca2447b94860068140fbcf18258909df5ba090ecab17d2a128f352e25998b9380656f4c253be1a4d0c26652cdf1503b44490a0d0a11480e0a300d5003a8deb15232028cba1385c249a7617e8cfad021c45ec7da0b351a98dd11933e097d0abeb083121f64ffae7c018f17bbf600508f08819e8b8801402000000000000f90211a0ac11407f8e3ff65146307c62db5b6ce146f6ec6c674749675fb904b1c45931eaa01239d6d550a8309b710b850a37562b64ab154988c4f735ad86eb14c7ab6dfd40a0bbf9c0f72e16628c7075659aec3452d254d52e975bc816bdb9d78459a2386bfca0b5bab3d2216d1ded32e4279b3485289acb33568b143ab836fa6c4f539b7c9861a04a285925bda8c740e28765a9dba14b83ecd859bb3637c6d844caff58bee9c69ca000951e1b56066e409ce8eacbfb219874304c358be9888408bf8bd46380b1eed8a039b2d141c7ac978662619dcf335c35520181241fa1c9bc76a9a6bfb20a5e028da0a23c25cf3a2bc782217e392272b341d77c5a762c07a50f886d8a5118fadebf0ca0883f9e0cfa440ac9cdf6b3d94284a253f6790d399c32cf36a39eb576c7c75b08a0a8ede7670ce33bc650e9ab803a55b25c61bdb04a3e9dbf660f752b023827b7f5a0172c926715894d8f7117fefa09c8d1da05cfff06877bb91ce88d315f55ebe669a01f91593c1f4404e45dc0ba286d2e7eef1a4b65883309fdc8010b2bd0c3506d06a04a2ca6395ecd65f02bfb38cbd7727619e3d72636e0cee353987dd7d686d13e21a09cd3a2a77231a1420e14ade64a951384bdae2cdf38cc4e4a1e6f9ed3b42892f7a03cbd5faea687e2d5d828f6d2b3d1d3bcbb7a491bd9decceae55240d372447612a01cdfa48a96847ee1da3008a91c4dc7bdfe49e97fa9324e7c30163542480e6160801402000000000000f90211a0a0e08650f842b947376855aae03bfdb5a509e6649ae9c73320615227d87a43ffa0285ffad2101d3d7dcd25a9b4f81f68c51560f381d62a87366811c9a817509c4aa0e3b67e576fb9fd50604d15e101820992bba92e284511754e097f0d3245f2ecc1a0c4d5029696b11751c5af017a5b7c6268063eb17ad97d4312928e93fb116b45bea0b64f7e62685ea2ae2c491405f89626324f21d79bfa1b00e798772cfdc1008682a090b9145f6a912ab09841bc91d4ddcbe1fe477976a71c89cdc2a774a34923a029a0e2df1875418007a8088223634583269bc010657bf144a4d3f313cb0e13e7ebcfa0cb57da89c1f010d8707fe248c5e1718255fa192b410fa4c51f9ee766295a2abba00f857b7f2260b0ecae99ccb4a74cd0ad37fa19b8364cb946ad72b214979db89da0ed7ac31ad08a18aae9b92687ec02fb2b438badc01c4af48d3700df1ecbf5d49ca0eee1f926aa68f49b073f33a537548b64d24bc8c451eafae3d7b40e9ee0940f04a07c25a21bc06267a64dd2259d97f9038d6630b1ddd52634921f92e3128fc52b26a0c64685cbac8066c5b157ea11ace61f69ea81b2c5b530036875ec1e696333408ca0f74cad4cd33cd2ecb5a05518820b6118f7536853fcc220ad9707210c553c7164a061ceac480fdc9b9138ade037689e3e3953c9775bd8bf618ee382068d3eb5f482a0b405f34b9f10145d7ded7f9a5b75719020a2c28f79320fc703299ffcf5043b42803401000000000000f90131a0d7a2da3f2350518e92c3269340fff25af27d5a87694359889f0cffa216a5d306a0ad86e21bafe8153d4950b4276c16091a79d75c4e2015d2dbb81f070f8e3018bf80a0200e92b1e8011c0be6e5b21e5ba2d60106c9eb39f06af9b0963375a07420a45aa0f6866a5b1b3f34f5ffd7f4ee35660e05fd8eeeb8901f3fe27cb8a7a7b5ee7996a09492929015aaf626eb4966510dbbe2f0c96b9ee1fd1d24586c72919a5ae16036a0fbbdb97495872db1461af482ef286bbc76055bfa48c0a31e218a9dcef0d12bff80808080a0ad7aa6905ff57b744f8c35f41c2f659f913592024e31eafb4ccb92cc3adbc6b6a0ca4cd47ce070d86feb814908bdb434055138560996e1b2041eb16d3cf37f956080a0f3484fd3bee2df3eea417173899c3602ed9c793309d4a30595748b33755aeaf480807000000000000000f86e9d34ba4b486302f01385293c430ca171df3ae0ef072a2c41fa4e4db7d5a3b84ef84c0188016345785d8a0000a01de7a7a170e3eb7041c47a8b99c1bf5de9ac91318adeaceba74f07879dab42c2a0f8cb3ff11d3c43193ca30b0cc6c21d1143f072e4b45bd4c2af1069c9fa69ca107b89fe6bafcca35cc3890c6dd8285730826f48fa0abcadf161c10f45619cc57c05000000000000001402000000000000f90211a0e0b6173a2e8b053b52a0c3574da9057ee99b897b6b969794711afbc1cfc91275a0f59185de360801aab843f68a80c1975707e1f859ec108204b1bdf61bdb1d8be1a0a517a30d1823f946ac62a6de5127d1fa5e758fa92e82ed3794315a21f2fc34ffa046cdf7cee2d547af55aa8316ccb03b376e16c84ed218ee670719f179629095aea051b0f4fb4b209ec094ff64865fc4d5f8407b30c651c4ce2c9d7f112bf117a5a0a03368a6102035ecbda2186a92aaaddbc64e6f668f4ef1c6259db69280dfcd2da0a0de131aa335ced6232d9f5e88e5f9a432d1d7e0d1288bc61dedcce6cfc9b33d1aa08ab661d633ccf2b04fe153fbb2d6ab1217bfd37f507261e7ca6049e30546f106a00ebfb65400e36517fd677191edcac048e8a4e7f7f35900d5b1bb2c79e9aea2cca0e75edd27bb630359db033b988e0bb37fa1d8f2c01c5174684a6999dbfb050241a0950a45ef44a435d25aeef583261d451477741f1b19a74c73b8ab17dca82862aba046e8944538ac47f86567906575ab27ceb28925bac3d9b7df10a65613b9873ca1a0e093e24934a427c4fe7caa4cbd510eeeba1fb8c6e81dc93c61aa81217514d0eea063e769e90415fd5dcdce8b9f54eae07c61f8b01d345cf29216f6d031368a32e9a006712dde632bb148ba06483e1961fd4a4f2c129bd9694f9206d2b19d8c3bcce8a0a4e77f2898bdc54fe0b269203c93989189b85d6055bf69c90f195df950313c89801402000000000000f90211a05ad8681af75b62b1daccfdbd3b6565984b15fe2f5be901e8b809dad5fd6a1abaa0fa1cbc4408ee09f559f83f8b6bdf7e1a9c1a1b47fa25396d368e6e75483bac5aa043debbea702015eeb1371ce31cadbb7599b1247852fb8201ea522ed615b1d039a03d116c6c17162df2e6d1d59d511cd47a60a9b0662f19f47e0b1649509d2a3801a0cc1be78b55735c8d18ff955866ad007d7ac046fc1269d0c2b0b4d7481dad9cd1a0eaa9d6332bc0815280b561c1b7d51dcc3909488e07207f73f9dabdf31c46aebaa05d1e9686a820537c1dddae03295d382ed47723a5e4140d0f19d0c2972953d1fba089308adb4734660c10ae7c084532a627f811ebf2f1f741c3263fd2efbf5a2e4ca01a92bca603f31664dd27cac4500e3f13bdd22e4524f8c856010448baeb21ba89a016ac564b383512f9cd208029d4908be2ec74cf8199b23105cc018c309c0dbc48a04ba90b7efd7c2ccf0857e5b4ca8466b7cf715cea20f1b1dfb1cbc9a8bfce45dda0944231bcb3bec7ff51484bd9f1e6abb57f5b4e105ea89bd67a4a81d772895928a0f248698a4642af3d0f813d9529269f2f3ca56577f850ed426dacb23165c46a15a07ed339b984a0248485dc5c4dd92aa67ff1feb3cd434da8c5ee3a5eaa2e8bbb5fa0c6a69439bb6c9b499ac9948f1363d16c8da82a7f063f851c124698fcd701d5bba0676e5dfae0f84ed3bbf50d4f9a83550fbb0bea0eec833571ad44811f4517b30380f401000000000000f901f1a0f59b5382104bfd77f69bba16c6b53a654dff5940fe8bfd41fecf246613ff889fa00c5d490f6c38a26874068d77d4a22b3508ba33310f29e213317e86a357aaad9080a03b948b2335c684efc083c7b60b60a5f777f0f693c9d6cba99a8444e1d24edd4ba02ae3d5e83009d1050cd30508a28e5034dccee1ca97ea97c949061294258f3128a0737b96a911490b5f7bd05ed64ce8e16485726306a6e1b953c21285182819c38ca09229062945bf57eeaee4413c1828028d0aad290d8b7919d4783828471432fe9da0a689b952aa2c190eddce012347f1f74ee058663a3e2fd8dc9ef2719c2e0aa615a0c954f875e8c129ec5e3cc7340c947f0fdaf63689da1374d8fb49a404e74117dda06f48e4855f862906b9527ce84874f21d513ecbbe5a20c333681ac4ce18aaa8d3a0748454896ebd53c9192c8a7f7db9673c522a8bfc8e4281e3b085d284734e1378a004426fef0787bb0fb516417c266b34231db14de3468c16882b58cae562d1f35ca04da4d339118f3eaba840256adb521573d743f0a9b84ca56dc8389991f61617f4a0a61cfc1837b68b02930a870f7dbe21fa96488cf9f04350d2bf3faa2aaa6cfc83a0f0d14789962f4086f1e932ad394a041e2599c2ad7e052a7117288ee5503da9a0a08f757d3d0d3b1fddedcb3ba08f7e661f32b41bcb622d24deb668768648df92bd809300000000000000f8918080808080a0d8e676c7cbdfbc4b13475fae8d6481b5a9492055fe83ab9d299d6a95654b321880808080a0393ff2a41ae17ff647c2e56b5fda645d0d33d1fc8fd3cb5f7c86e6169b4a82cda0162ba69ab31237e96d52e1bd28e9d576e4ba34295633954ba49e2248d5d75363808080a077b4819e74f084478d976f7947584c59b756be411c5c3a3f342058fe00f49e86806a00000000000000f8689f20e578ca3dcfc77ac5e235142eb8b09b622ef3eb05ea20b3bc5decbcff643ab846f8440180a07b89fe6bafcca35cc3890c6dd8285730826f48fa0abcadf161c10f45619cc57ca0184bc2674bd0d20f66458021bdd4efe3300c7bc43e156510d8880f643ae2d8f67500000000000000000000000000000000000000000000000000000000000000110100000000000012010000000000001c0100000000000037dd43010000000004000000000000001402000000000000f90211a03e32e6db009e4ef895286921323fd6542cc37123bafac93991fdf33ac35ff809a0f15d4937217ae4453fa3cdad536cadbdce227e6a14823236d206eaa5c52ae41da02af0246ea6bd4fe3e10d2bb99dd252a3401fa6dc15d8d21e396046793b041c86a0f824605318b3bb9f7ae5a33b586e30fc2fb160d8aba4423f13f15eb90d8fb527a0d7b2f13988ec994815d6435aeebf79657df886c5a4f96bfd2436f672c8afd959a05c29d221f2d7890732aacfac2b0ecc65ec2b2dfc5329063130dd9ed8d2d7948fa022e30e51d2bc9a27d02dda7c80c50a62d0693e0d599e363e8e908553a7bb7582a00c38b4237f13a5fcd00d36aab3854ac7ffc347a8abaea67e4f22a9a887cd42b6a0b7a6897c2e8735955712f4dc0ff32f1cf46a7a2bdc765901105d0edaaec86326a078c2652a29ebe2b12a21fef3cb631737f87a317f7fcc95577b668e13547466d6a08a2c505677c737371d4ff4ab6212f54c32e71179933da0142ecd58e9d1a2cc11a0925fa663912b5e7e58d34b91e5ba7a31e1870c8c799dbf808d61bf885597fa04a0b9e3122c64ad814070be501e156cbe76bd9849a30b898bcb54a54441bfbef883a0258ae0366bb778e147455af435544e22cbe5d322027834319d837b70d72c873ea0a9367481b7aef38b5e512945ee82fa388bc2d00cb83ff4d1d0bd40471ea048eea08cde9b3e220f18da646382af65bbc51974b0a4119611a68ebcadc7d7039f87bb801402000000000000f90211a0df05cd421c27bea7eeb726975e53aa21331299a8d2a50e6215cf9d84a0026718a002d3ded22ddef400ebef45a95b6c1d1592a19804ade78955ef0fd7b22dc09e76a087dbb81ca6454b76b407858f7cb327a80ac9908ff6ee073be8af7fd0b2bf7cf7a037a83e8d94c435e230f4e488cd6a7a6507b6039fd34915072b13a9964d41fa91a0e4bce1b3fdcb520cf84e65c12e32d8644acbdf88d8eae2c2972c951eb597c128a0f389634bdaa63b65b6a8cd32ac9a5e26b75cf4b672834b3ac5cd412b04a31b11a04c6b5619120243bbf63758de7b351960668b9510ea337058187a773731507f4ba05f44bf74ff144a6e655bef13e911c583f7dc2b07ea942e42f73fde813e8a4079a0bc3a1d5848ac5fbee3d0c846bcc0a229ef279c2657b864c96c1d7855569fbf9ba0e80273e7973fea7505efed4d5c18afe044b8e9be2d06717845011f26b84e6c2ba0b3479af58ffc5b3af8b9bafa06cb5215c2575d36afc0cedfd03e9318eabaab0ea0f8b8200f67082410e98f2e850104dbcce3f84d0ca192fa8b9a95b32d9435badba0afd5d326cde66680622028fb40bd2434251ab9560a0d357967eddac5dfe81e31a0973b6e66b3d6f38503635d5ec62ba225ea4ff511f0254f0dee7383b75691babca0912cf2c4bacb4548b3d430c691794421796166cb3626ca82337d00609e9c5d76a0322ecdbb59f0fe57d58e47ee0950b393463772b7dbe4d56fee2680b64f4a8500805401000000000000f9015180a0086c09da30094e0c3f88701c6aed536726823be02844a51239376d645609af3ba0c132f8520e86c5479490fa481f9325d6cf607ccd533cf853e78839f943f4a1fe80a04a2f7c501c1ae6d1714b60d5801fbda2835ad3bd83362cce093b8c63ccd67e4780a08d49cedd04f47e886f20ed85b9ee7f05f182e18a82828576b5c80f22b11051bda00ee9a820eb147de07eda54c050cb5f013ce9e558f3c1d635fae588a1fb673858a084d0e79692832cd369ae2a251775012c16d5eb92465b0b99eb1ee5803112d08580a0e28b460ad6d83adb82fef64996b6bf538f2be1fae7db13e63d27ec45fb9bd98480a0d921fb5c3ac823d9d77194b4a1f0e3aa407873d6452dacfe56cb06d4a824c29aa0a71bb508a66699fd716886ac283d62e1fa57fe8377788f06c4f8d1c8f06ca15280a0ae85e0c0eea8f22668a7eb9378854f21f34d0fe797d5ed648513faa456a96101804000000000000000f83e9f3d93986a7b9e6294572ea6736696119c195c1a9f5eae642d3c5fcd44e49dea9d9c0143dd37000000000000011c00000000000001120000000000000111c525d16f4ff093a16852fd06476d780d54f0205aca2addb062bb2be52cf7126fe523f950ec22a65737b98f131dcb8b2eae73de19414c76eb00101ca04abe033704000000000000001402000000000000f90211a03e32e6db009e4ef895286921323fd6542cc37123bafac93991fdf33ac35ff809a0f15d4937217ae4453fa3cdad536cadbdce227e6a14823236d206eaa5c52ae41da02af0246ea6bd4fe3e10d2bb99dd252a3401fa6dc15d8d21e396046793b041c86a0f824605318b3bb9f7ae5a33b586e30fc2fb160d8aba4423f13f15eb90d8fb527a0d7b2f13988ec994815d6435aeebf79657df886c5a4f96bfd2436f672c8afd959a05c29d221f2d7890732aacfac2b0ecc65ec2b2dfc5329063130dd9ed8d2d7948fa022e30e51d2bc9a27d02dda7c80c50a62d0693e0d599e363e8e908553a7bb7582a00c38b4237f13a5fcd00d36aab3854ac7ffc347a8abaea67e4f22a9a887cd42b6a0b7a6897c2e8735955712f4dc0ff32f1cf46a7a2bdc765901105d0edaaec86326a078c2652a29ebe2b12a21fef3cb631737f87a317f7fcc95577b668e13547466d6a08a2c505677c737371d4ff4ab6212f54c32e71179933da0142ecd58e9d1a2cc11a0925fa663912b5e7e58d34b91e5ba7a31e1870c8c799dbf808d61bf885597fa04a0b9e3122c64ad814070be501e156cbe76bd9849a30b898bcb54a54441bfbef883a0258ae0366bb778e147455af435544e22cbe5d322027834319d837b70d72c873ea0a9367481b7aef38b5e512945ee82fa388bc2d00cb83ff4d1d0bd40471ea048eea08cde9b3e220f18da646382af65bbc51974b0a4119611a68ebcadc7d7039f87bb801402000000000000f90211a02efa6996aed85487edd790bf6bcd928dc319ef1c15a0fa082696d9e17d90967aa03d80649807fc1a6284dd05904d93d2afbf58734748cf2cfe8f5e873527bf558da0b3d0e24fcd4b74c6976adba62a900b4f4a908a3eceab2e3d9d9640e78153db58a0343c77ab7a3ec3e1498ca89eec0f23e3e8842e00fb1f42bfe1b0a52bdc1d9e67a0db6f38bccc3953bfc7985a25dd02fb4855c637822b3bac8297bfe911dd8593c2a038523efd8bbb7da6cc69124077f12b999295419ad4680f978424dad7b0d44f05a009821592663110b30ade294b1b1323305b0f04aad26f9bf0378786eed2daff8ba093cc605c329dc235a6b404eff5691ae39cb44131621c4d1a5f828484cdb93d08a02c353254d76637d3dc0baff0c4165ba7edd8f76c9c323cd4bae68ec1b12344a3a0c029c7628bf70f3b7db3c7c387dc0e8039be015c0b837ff7307eff78150b18faa085955b08082747c444948c8387a1f13cf838ee213ea244bce42853aa971186caa0d6c6831bb91e937ba1a09fbeebdd7443336d91829f5c363c6e35fa9823f16253a070a66e27567dd3797a90dedf16317fb8329ca4a80649efd417148ca421627412a0a50ae0ab59752da17fa920712f391e25f168525fa7c9b45a5fb67d76a810ada4a0029cba6369baa0a438f4c3fb093b039fac8a635ee0489f8e30afc49758f73c24a08a69b52e0b76e47c039627c802eae01bdae15fc85a3441a9f9844847e8e5c9d5809300000000000000f8918080a08958414358972c56d9f76d07406cce0d3b1d0bcb89645c1392b96fdbe556151b80a0af068c8cfa2d3c29b1ea4b4f0e7ec830888c24ff1fa31493b073e6c5c0d36412808080808080a0d00780fe30340af5571331a0c2b597b83319fcb2f31243e21bce4e016a8c8dde80a0f85f085c34c2bbf95dc4e324b122704dcd2c4e6c72920a66acaa82b5ff39b8788080804400000000000000f8429f33561d0329b48b6767638ac7342fb539eb2ed873a8b41426e7fe8c004b65aea1a03703be4aa01c1000eb764c4119de73ae2e8bcb1d138fb93757a622ec50f923e57dc86e2a895e54d3341738acd313175ade05ea0ffa33743fc836f3cc9d6be1781dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347a4b000000000000000000073657175656e6365720bfd807a740e5029132568f7466486a228efae936d912a37d7241bac67134bb3f830bdcaa18a86f1b387c10b1c94388f150bed2af595282f370563038d473d9374307411b0f3fa2a5c993b60e6c29277e77585d6e84436241264292d62b84e1600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000100000000000000000001000000008008000000000000000000000000000000000000000000000000020000000000000000000000400000000000000000100010000000000000000000000000000000001004000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000001000000000000000000000000800000a001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000dd22060000000000000000000000000000000000000000000000000000000000000000000000040085d6010000000000f45bfa6700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001538d4600000000000000200000000000000000000000000000000e20a1070000000000000000000000000000000000000000000000000000000000".parse::<Bytes>().unwrap()).unwrap();

        dbg!(&header);

        let ClientState::V1(client_state) = serde_json::from_str::<ClientState>(r#"{"v1":{"chain_id":"21000000","frozen_height":"0","ibc_contract_address":"0xee4ea8d358473f0fcebf0329feed95d56e8c04d7","l1_client_id":1,"l1_contract_address":"0x828c71bc1d7a34f32ffa624240633b6b7272c3d6","latest_height":400311}}"#).unwrap() else { panic!() };

        v1::verify_header(
            &client_state,
            &header,
            hex!("df342885026f59355558d4bc2fe6f9b4e66e6edacc68fba65e1a694a05400e59").into(),
        )
        .unwrap();
    }

    #[test]
    fn verify_header_v1_works() {
        let header = serde_json::from_str::<HeaderV1>(r#"{
            "l1_height": "8051156",
            "l2_header": {
                "miner": "0xa4b000000000000000000073657175656e636572",
                "nonce": "0x0000000000000034",
                "number": "0x2ae9e",
                "gas_used": "0x128ca",
                "mix_hash": "0x000000000000000200000000007ad91000000000000000200000000000000000",
                "gas_limit": "0x4000000000000",
                "timestamp": "0x67f02db8",
                "difficulty": "0x1",
                "extra_data": "0x5fa375a6a86d04dc75595355d967f63e4518bd2766f2454237ee4dbbb11cffab",
                "logs_bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                "state_root": "0xa7971e3a4adf60e683572de22667ea46fb2a597261b6a4749c5b2297a04b90d4",
                "parent_hash": "0x9868881ec896dcf537caeb2deb371ddf4975a6ecb473c8791b22054d8bc6e1b2",
                "sha3_uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
                "receipts_root": "0xc026d2807d75e2c59d55e8131b521a0eb10e22d05d6e173c71603b4f210624ea",
                "base_fee_per_gas": "0x989680",
                "transactions_root": "0x8e151707b4ad89fbb97a73ab226a435ad91d82eaf4000ad800ed4d101987437d"
            },
            "l1_account_proof": {
                "storage_root": "0xe9ca59b3635edba070c485eb5d402e3d4b58e9ca6c84f27b217917c458e36de5",
                "proof": [
                    "0xf90211a0d541d8cf5bce2dfe8dcd7c4b168899ab788464fe000da998285ac47d87bc6e07a0f75f533b21f6fcbc36240dd82bce7a38b92c61a35a86e71896cb83f245014f3ca0cea8d4216cca009b4508a8d1c00ea7c6d3dec3a0cb53ae998fa21680d940c443a04263197c4c12af8b35971902d23ab27da06fb5ecee640ee98b39e0361a3581f5a030a90752aa14e3b3e7d34984acb6087a9ab1d2bfd60e6572a0444892b78202d6a07793474e09417f4678ee148cfb9603cd2bd83d7a7f6bd5c702f2ebd8afbfc629a0de1ef3394a155d0a9e60d0049af46fb9939a576c55dd36bf515dadfb49c0c3eca00d81b393f3f62793d4282e253eaed48f6d1c2cca1e8e619b6ce65bb8652daacfa0dcafa9ba031aee839c29dd7c9b9f994e35eda26e280515575d8dcdd04eee6712a0744ab587527e0d5dd6042db4b1b0d90339aaaa5f0d3191386b42f0e06d73087ca08ee12c3112ce380c7e8d20998851be95a138159f81f7ab9f76c19fd1f4e98689a0683b53fdc725d009c4b92e91e0bcd284b1a1dfa9e1ca62176a14e6123bdf7f00a013bc42c2897538fed75dd2942e7deb701bdaed539cdc97e25123d0f783817e19a05e56c73c734ed7b058369d21e5ed8550a3c60dfa1d240db92a4dfe600a5112cca0c5feb16ae1a8555477fc222eaf0d27bae15bff118c5339970aaf7339c6120a64a0c6fc9df654a4da9bea2fdcbfcbc232c15e6543787c44f0681dcd912c07ba594080",
                    "0xf90211a0bb52616c7947f25f8ca7b7664cc2b5ad081627e1ab274cf08223dd3c5e214554a0c5bad9c5a873d607580187a4429c3ab3ac25d61973bbf194786e95f750a9c15da08d910aba9e21983cdf61280a14d264d8a85258f089b59c51e068c45f1e7c84e7a0993a352d406aea64d67e7eb17fb22769d461f4d69b56dda475863802e155c812a0fccde608229672a11c4ef792a6642a370727ff633fbcbabd7426b7425a44217fa0a1e8e29d3a9f0d348d412fdb1b07f72ba345f1e31001e77eacb2a0edf47a349aa0eedb58f7264ee8fca52701edfdcaa938f2f3166646bf624532cbce5f8193b5c7a0972a31ee217799376011990c9a2209fab9724df0092d8ec167af7232b1d7a10aa035a6d7b21622f7b1376ac92e906a7d1a17974180e9c105dc47d5a5b37665c767a0e3f9d6c8622d74d129d2a86d5a0799c66f0e741d4c6c0091e5befc519bffe602a0b98c665ba6b5cf939fa3a940b96b1ff3b096078800fe80b65b552def5ffb035da010ad76e4b7f0fa91cff754bb5a96e331ad0ff7b41d2f2ace13d2097cd7f5d0cba03acbcfe65ba3dd8e60e4b8727aee6ec2543a3928bc94fc53b4fda75e02d24f92a01037a58a6301b90dc404b95f6ba62dd7b285c7a5ebfcd4abfaa93d24bb93df19a08e98303e28675106d4a6a2e8e05a83a22a49c80796f1739e8059c039e67285e8a017dec260d2616b6ce372c4ff4ac35ef295d06677eef269f05e0879aba15987d780",
                    "0xf90211a05c160f4572eb47c59662e27bfb51527b69514ac835fc279cf388f23e331a0ca1a0621254877cbd01c72f904e9b659f2be5c00f2021bebbe6dac835d34555f1dba0a0a0d084da3b99b1777b84935a3b1ed3c88fed5faf9a84bffbd3b8e301c64a69d0a0d67e5090bf4eed915b85a7e77e99521d5a17e2254b60a93eeefae49cd4d62b1aa0fe3f8a915ab993213bc172328c8434843ea48e6f733757803e183b7679e65a14a05c13d2241e3a74cf22fe8f5e78df370834eb338aa7eaa1c25a7eab5edc4712c2a0427eda7a761ee4a53eb63d1a0476bb31789a264ff492450c8dcdd9dc47aac198a07c13517d1801bbcb3ce36def6950c918afc02954e7f3076078fa12af0f7ae6b7a04a4a547e004bb9bc2dc33a0de80efefe2e8c255f170f3ce3f2836ab4522d1be3a00c82badd591727ea1f63f73bd105fc2b798cfd592e7ef9f1ccbb1b0a059ced49a09177a8f144cdf3dd065b94611584adb832c516dc61bbbe34b79a1fa7a2731c9fa09328dbde85ec109c1065bb65b67c887394fd8348a36d91b3f74e9d27f4744daca0a5d6a9a5a4cc6829065af32651ee3bb24f14d0577ef3a34b46bfad062b035f87a0269bfa5f8c8e65106ab4127c5c4f6350b6eefd405ab27b63518bafcd3cf3b60aa0af5ad7ecdef904bc6a52a1df2911dc10edff6e8ef3392a3f0da9edc75943b326a0f24ce80a8e3629af34e7a489f4cc05c485f67ee953e66b90ee904371ef9d94ee80",
                    "0xf90211a05054fbc633d5aef22a04d08e891642495783be46d4c11cbb132e46088e2f2cdaa0aa4cab63a5b40b005cf77d5f0d5cfb75a60c82431a346e42c311ad7d7d92d97fa05818d38f8e218b5acd5467950d8c394bcfe9fabdc23ed849013d7b6a138152d4a07452570896039998e7231d58a5c4cac33bcb218fd221be90808c0b301c1a626ca08d786be98e8086ec99ae6a3ea7333c55c0209d7ba0816a0302e3d40bddb17668a0a379f2adb70ccdf4b78565a38ffa02e434cbd4701bc089a7bef9453159f080c8a082291cfdb4a8fb9e3de71097b78cafdf2625009da9856e88a610914010573058a0b8c21e0e8fc5c7a7839656a3dfacba31ec6227f22375e06c94808dd717187d94a0a0700a6a72cdc3c7b11c65063fd809b659c5487f750a46696cb95ee45c9da226a092f33b1f6daa568524704419faf0cc476096a37ac4b3e0b278b0f6175988c31fa07aff7e1255ba555664c431c7e69f34e9939ff2afb8830e8a033dce8394669ab7a0f250cbac96592a3fd460e3147335707e040898cbe2a176d3603015f676497b6aa01ad0a24b4e280bb361a95bfda3d5514a7d8317527b5d85f0553591e23f46a953a0772e5cb725d0fb5d35bd358d43b8efde96833af31261349a43a4bbd09a24562ea091d75c77286e5b863c8232a0faadfcbb14c9753fba65a56c2da0e348e73935c2a0959aed9e30ddf73859fe1317d4f9ab4f6fb11776a971693974b3f1c3f62b167c80",
                    "0xf90211a0978cc80d285df07c64f6600be4562ac03ec28db895740506bad69f69ca673e07a063b0d1328f834dc6fe28026d5986669c0289767eea5948609d0eae7e311c938ba007f03e3b67c6a3a64b84107c0c231c07cac255ae8079018dae8013fa86e5f3bca0184d558df5e9cc8268942cce5def841feb137f138b537ea51345b9c9e5437609a01a7263a224e8a01e77b8d6662a4ca63503b94d3098f85f9c4ce6f34c3f861a6aa0671c2eb9a405d161a16bf3e4c55f2efb0493ade9cf4bf8b740d0c0fa4b263396a000d9c46b54c8f3a5c59774599b8299047905e0d7255e2e783a006bdd05709b7ea040cdeeb856346896337c5fdbec24f40e78861ce0a2844f2c5412345b09924a5da0b74a9be81b6070a57a58cc1119066420d80094624f16716940081129ac846959a09fc6d8ac16df42ccd50ca5d34ff9a84d559e762a32abd891912a46580e298be1a0d96c7b02f783614bf755d4db1054eeb00b1a9a64de4c7f1e0d7e66ac7ee05b52a00ee1f38d34053f99ad5e4df7fd29e3cf8dd9dbd3d2bee027672d7e0622cab466a0157013cdc8366e2c42e39d2e4c17938faf983c0e1ef5377939135c43435ac874a02b937fd3ad8dffe190782d237bf859cb0584b61fa88aa49563210b18132267f2a0de232f38937169c9789c7fe8bc48e208f8ab728594baf528263707138ce8e718a011e97b7a434e0edae6a8a77d3472f36025c1798ca5afdc0c88e586a0480bda7a80",
                    "0xf90211a04711c5b2e10040f3844fa332b369fc515ec8321ec8c706fbdcfdd8a1a7903276a0de0e82cbab661d44f4306eb7870b3bb02da902921d6298b9162e5fab8a1729ada08952e0684f9526724d2eb2a10da9b20856ea919345f68791c70ed7a0c201f1d8a0c722ed649bef6ae586c67c5927f23fae1dd79694cd1999376b3935fc86188a63a0ee5ed59ea90658958c94adeed7922e5c640378151a18ba63ee7472565616b047a0157feb8fd0382e5709afb2d3cc09ec1f530b73224234e94f9c088443c704b675a0be321a42abb683ebc95df94c757800a25d3ea22a13ac18b9350e2a990b48be55a09af04797972640735d9cd95c73b5f647d518a286ceb6acd734747a079f37a66ba0bd5fdebfe176701ff0616114f6250eb682adb4ed8fbd8f1f7b0c643daa231401a01643eb0cfbc20f03556341f963412938f2f8fbdfaabe15d37eac256d317b9b18a0f26efb33476a49730b42cb9dd717556379710189d77d6174f60728c7c8d58ad8a05582e0c27a56ff1c98aadc2a33ac41e9ecd4953e87ebd16861ae0e3817cfb990a0f350a004b79f81d237ca9eb7aa794f36193d78f73720cb381a69c991c0445138a019c0e8c507b7acd7e287f3a8e5c2532836ce05a60040881b9c38de08589f8070a01a11e897fe1afa6308c7e652691edc0ea4d437d70aa3bf15fc2da265b81fbf59a014a243fec58fd1b58f3a3aedf15d347694a0f1d6456e7c0748b3f2badf801e0680",
                    "0xf8d180a042925ca70459c9565b5aaeb43d72ca0f9604e2a2bdb35fedaa4a7bafe6d4773b80a03856a7557eae2e5dc64b0e0df937da9ae2091dbf9e7b3088a4de55da3e5b1d838080a0b094f9ba65db0d58db682564e1ae3f25ff484d008d47e971972db6e7344e300780a0f25c1383a6d7041a1846c9f3c844897c4bcf20cf34d55805d1c056609e3a0a64a06d4331d28c8ce60111ec265e1511273f40ece94739dad37bc66f39c385da183280808080a0fd4f390f5c1441111c971caef38057496edf82d16da9cddeeb293e63e46015c58080",
                    "0xf86e9d3d290908223223d510abe09bba785117a71bce51796ea9a88be577643eb84ef84c0188016345785d8a0000a0e9ca59b3635edba070c485eb5d402e3d4b58e9ca6c84f27b217917c458e36de5a0f8cb3ff11d3c43193ca30b0cc6c21d1143f072e4b45bd4c2af1069c9fa69ca10"
                ]
            },
            "l1_nodes_slot_proof": {
                "key": "88600565507719433665650673477680347858252592813736026404486188513770717830104",
                "value": "112303809160144616231331421733204809404426618259802767219241643237959295740460",
                "proof": [
                    "0xf90211a0378976b79a40d72a7aa1c422c02e67df614714be62363422a001007363aa34c1a0505128b8a90c1ae06d7b4e79d181bb1586be683d56f0eb5eb2f38eafe166afe1a0b784abc4936bcb27d8355b8311ae7644ba506a59c2f7061b7d52fc4c434c0517a075b64f474b83dd0f55e5e16fff6512f7f85e5ec1a1e5cbe9148581ba4ec598eda08d6b503164a45e76138d40a7d7e56ff91549ad38530f3b6ac7d4f2ee943957eca078821092621d2e3f7f621e8d15c9da570f234fe0e644ff296a08c1884b312f9ea09cbe765dfc6f7e184d967b0e03ba578282b528d6ffdef601164940234ddea18fa0cef0ff64344b715000c483f788016438774e6cc8484cdb18cc361e7b245dc123a0fdfa1e446df19af67f691121361499597993c65e69370661d03ef922a3f78910a0cc5b4e0cdcd2429154aa6a8c08d01c93cad7413044f21df107322be09f365abfa0af8ab900a5b8352836adfd6d0c7f30cf9b018ea2ba730312beb4023bf73666c3a040d0f37dff843b1660c606e8f03b1201a25ed7b0fbd3098c9a1eea576fc21ae4a087922516d5a213262c42af3c84caf92f9acd9d65e442e318c4e8fb2e1566cc86a0f89b382075a2be2fa560e9b63ea24c8bfb3ffa5fa94b4ffaec55be27efca1ca0a083315309a8356f86aee6a56e8b92d728d099abe32fe091d9b7d0dbd2b5d2bc1aa017f94590b4244ded96f036bdbb8e0922301bf3b3bfb561d4bff8cd5410e824cb80",
                    "0xf90211a0863679ec0454588a0733adad6a0af8ae177a3ba56f0d0d2cfcb294b1a2efa62da096d1ccb485e8a6538cbff3f8e989c8b57daa43ba54d4717383d24b4bf45552d4a0f7a35bdf2753ea50dddfb2ee811873d29b8e83613d2df2cd4aa5fc7f501b35e0a02a98308b63afcbee1a779a2aae53cb9f5dab46f5b24baafffae54f975418350aa07b87d8de54b8b0b6945cffd1c1be53c7d530fdc2f499d6d0515b8db9a5315bc0a0cc7dabb34be65524d10e25bb09b3c47a9f457bc7678ca51c767608b21ca6dbaaa0beca59427f4bc6acb8204bfa607cf74c85093c4bf591623e3fef98ca134864f1a0da11873347f8991a797695517fb47fe45de8423bb35f4398f714719ba373faf9a049307378d751d01eac8cac81bb2c315fa7027bb22cc545c7afca11fa4f1de42ea0898a5881ed64c0bd79dc31dccd65f58f5515ef87d675d7753f5674079c29167ea04e6e21f6ea49fa5bfb5107a748eaa30d41ef4034c96584fa51c6dc53b763a2d9a0d4c28dc349315edf18e4dfe22c7564f44c9707bf7914122943f98ee6cfa6bce9a0763161a3fff1845f06160938b69831f55c50582c66d1d4a4be79272427f439aca03762f50260303bce37c27cb02908165dc8c97ebd9861ba30458093604b00ec63a0691cb19e6e8b2d57bcf2844c463e2dc5306dbc05fc75b5e394e236e161fa8272a03faf00222a1eb436ee5bcbc030fabaf916b93b5bf9b65612c61d1b31b38360a780",
                    "0xf90211a07fdccd6544571509ec850b5017aac4687872dc300b48f308661c7d233da34f85a0634f666f9675771b644fa5fcf693534db1d0911ff3254f850a94d51df55531d2a079db1933674b6362429f106f930faf675254cc661b281014c5703c8c2427e6c0a0af0e7ee62adcabe34c5c8e849ba17d2e504e59146820ebae27e22a3d00af58d2a0b801240c6eb6686017d74c49cd6b518a8f8c5cb8fb77df3eaa01368c5dd7e224a04e05ebdad2f01645b87b5ba4c2f5299b05da671bed6dae861540ca7c2a4562a3a05874f89d9447ad3fd665d18301afb1a5374846945c09515a2eab75cfe8b693cfa0cb39b5fa0f3dad2116c08e09a741b3c317d65a76bf23d407c4a5fc66ddef629fa0a7c95c90b36fee018b7e80c0c0725731dcc952cecf8cbcebb5a3544b32e7ce90a04927b34d091fb09c284e6f94c506c751f2313ae5671f9aceb2aab6b956733616a00f30c9649ad30b63e9b2964ee0f3259fa1f3a709ef73a2066b396007eccd5258a055d8ab0a21b76e871582effc5b9b127b858624829db034b438c43595c1afdd3ba0545927af0fda4d42baca4bed7efa98d8a585c61b6bee6b782a601e6cb492e16aa0eb534d1ad27f3d5721649050938f7072ea0c2f4769e83c63d1dbc3a397e7f3b8a07b94ca084c2b4131de772920728de73329c79183d1fe3c86c1a47c5cdfa01575a0d7cdd913deec4e8ca2e7cbc8f32cb2e48d392ec5fe62eb142d1896a5e40e205e80",
                    "0xf8b18080a03df8d46c2e4c68ccffae7848d732de11d353d5d993da7d965f1a82379f5153818080a09db0851c8bbde9f119946aeeeab33edc828c85f74c9c8c2e191386fa5b0f303080808080a0424abfab489aae23478cdb77d94884f081016ff9d0f19e5323be5b48ab93fba38080a0822cac0ead8bc0b754f7b1870f173d82bff5927133b0b7d8ff7e205d19fcbc2aa0ab1a33efeb6e8429ebcd98abc372ee0cb9995697f225da0ef6821f956eec6b968080",
                    "0xf8429f20e0f749549f867317422ea4090358c6bd20c9c8990b900e176bbc2ebb9cafa1a0f849b414d30876070fa6c341abc918c39a76f69de5422695b92e50710ce2aa2c"
                ]
            },
            "l2_ibc_account_proof": {
                "storage_root": "0x6e1d668f9bc508331e4d6804f230107fd360a50e9ec44dd26aeac30da7b85d9d",
                "proof": [
                    "0xf90211a0cbbc6365c3259952ebe7a2b19d2cc328db3e4497aa219466fbf48e25c82cad35a0301d10da5257c53c2b3725a41de2c0ae68a7aba488bfdba8cf19b879d3a133c1a039737835575a621144fceceead026dc4d7f282bfaccc9003183779c59fb89792a0cda89a1886a65fc1145d6ec1f53a6e89bbe5fac14b4056eaabb2d188bd103721a02322b8140abfff8d8f3b0eca34de0e10869f1a354f3c6edba2d99c07bc6dcc10a00aa2e014f035006c09c56f4aa02caccfbab1c38406d7d817224a8ea8b044ae1ea0021df9a4351e21a0ad7d69ca86a698bc2f6266cd8d763f67d0484ac22ed1c845a087c442a4aebd380fd12b06b041054e841bc1f38554d2e8e4da33540d80a7114ba00bf92a8f32545e3ac334d02accff5de048c148f886bec549fc651dc8e37c7583a08ad6a7449b31ca0b250a6160f88469c1f5abeafaa9f4af2e7da016a660c1f66fa069d924e97c2b68b5a34dd485a0f3780fd675410694d22699b85ef4092c8cd738a0d592d7980c25e4177549f3ee7d83d6bc3d45cb887011120973bbbe46b1925610a0391fbe58b4eece2ec8741b8e163035f7aa81696ff9296c513c4898bfd90f18ffa0feba7153bd2bf48d77a1455fbf0a6caba25acb0f002f26d5cd93c6da75cf0461a026b88f37cae95480736d54dc6bba44202d7b20b13e01b36ae9e22a86155d17dfa0b0be8d8247248eb15a219ca02a55de1be444ac6f9e9896ac672bf478ca9f66ed80",
                    "0xf90211a0f4a70e0b9825050faca828d18fedf2a81ea738b5e85d4e92f8d8f14f3cb250b5a0a466007d4c13caae96d1286c6a8df7953bc78c32b3a0743970854c9cde88fac8a02550a172dc75c686b1d2582dba0c180f42830f76aa88ea8238ab7cb27e5b6068a06ca04f9eee1f3cf81d783eeeaed2d1e48509a26be1e002bd7e8995bce9aa587aa04ca59c3b982051523cba415dacd9fe47e8a863c8facd929d0f689d4a2c1be7aea0b192c0ab431d352c05b41579a875c2818e0f7d86a6246df3ea64b19ad0eeb2aca0f4e973e9e12f651814a13f6f04d46e7fc5dd01ee8c38f680416624b47928fb57a0210cabb0d2c46ce2baa2ae7fa85bf2da5e19d711fdc5e8f59b9a57154b6128f0a0582696919362619cb56f97dcea5e657bbd20d735b23cb862de94af09c73de4e2a0ff610451d8a8c66e6ec321169b674b421afed93004b75a11913c6c0ddc866e10a0a5629693ff0a368cfd8884bfa3d81d5737e3293a2acda86c5c101f8c758b5c63a0246600afb55252ec2f8cbda5afc6468c1830727e45aa1a9ea11034dbbd74f442a0d64bf6df75cc641a19dbcbcb29ef96a239e6bef426c1e0a59f592138d0e68737a084e9b0d74146a07de7b64ba874f73b58b6f34112a280404fc5ca33fd09ff3c6aa0c03bbee301abcb3403b68bdeecb199936f1bb0bb557e0a05bdee1d85a4435877a0c8199e4436ee73d9649b3f1fab2a3d941cea92c928ef181e23c86a9c611fb14980",
                    "0xf8d1a09d0b8f26e5709b0199c227afbd74a3f961d9c3e1b8de9128b060d6f87f36b92080808080a08a5c74905b21551ab81ff4ab60ffccbc77c3f63ca27a7ad89554fcedc6fb7f1d808080a01d389fcfd29047e74d1722e9ecf9a7d799376af387da16cf827a44881dddff11a020a76e5989b853053cea316c04e9454d42762a8cd99be791f7795543f3ba195aa01257f98eeedb62783792afcd6f9b8498dbcf07a488c3862a6a756274e1240857a087ae7ac62174d46489c903cbbe1914fcf076e7c92d45ab33f438023b98e1756880808080",
                    "0xf8689f3411163a2f29c7a6becfdb946a45129ed5cbb7be9ff8e64ce7aed2ce32af20b846f8440180a06e1d668f9bc508331e4d6804f230107fd360a50e9ec44dd26aeac30da7b85d9da0795c57e26220fed91dd5e491403ac8c689238eeb3ac1f841e1d9cc3222df5f9b"
                ]
            },
            "l1_next_node_num_slot_proof": {
                "key": "117",
                "value": "44179302843844739564926425000897130190127930798988182312636648464",
                "proof": [
                    "0xf90211a0378976b79a40d72a7aa1c422c02e67df614714be62363422a001007363aa34c1a0505128b8a90c1ae06d7b4e79d181bb1586be683d56f0eb5eb2f38eafe166afe1a0b784abc4936bcb27d8355b8311ae7644ba506a59c2f7061b7d52fc4c434c0517a075b64f474b83dd0f55e5e16fff6512f7f85e5ec1a1e5cbe9148581ba4ec598eda08d6b503164a45e76138d40a7d7e56ff91549ad38530f3b6ac7d4f2ee943957eca078821092621d2e3f7f621e8d15c9da570f234fe0e644ff296a08c1884b312f9ea09cbe765dfc6f7e184d967b0e03ba578282b528d6ffdef601164940234ddea18fa0cef0ff64344b715000c483f788016438774e6cc8484cdb18cc361e7b245dc123a0fdfa1e446df19af67f691121361499597993c65e69370661d03ef922a3f78910a0cc5b4e0cdcd2429154aa6a8c08d01c93cad7413044f21df107322be09f365abfa0af8ab900a5b8352836adfd6d0c7f30cf9b018ea2ba730312beb4023bf73666c3a040d0f37dff843b1660c606e8f03b1201a25ed7b0fbd3098c9a1eea576fc21ae4a087922516d5a213262c42af3c84caf92f9acd9d65e442e318c4e8fb2e1566cc86a0f89b382075a2be2fa560e9b63ea24c8bfb3ffa5fa94b4ffaec55be27efca1ca0a083315309a8356f86aee6a56e8b92d728d099abe32fe091d9b7d0dbd2b5d2bc1aa017f94590b4244ded96f036bdbb8e0922301bf3b3bfb561d4bff8cd5410e824cb80",
                    "0xf90211a0893ab29a493fb3ae9c72faa04431fe2a0d54df7b9289f3a2daf89e0b963a54f3a07a7d2d1847a8bf7c72731339bb0db95a99a6df630029eb1183d8906a1f760404a0df68e1ac3e12be190a1daae7ee09a3a84bc50feb1fdccb8bda527d79028301a7a0def5df6fbb25876484e5524c01b60d437e5b42451144d958453e0e167ed5b8a6a0ff9ac185786d6b40be5a3c7c897bb7eeaea840a3c02cc64e72b88651fa9eb917a040abaf7745dfc085faab43e8f64b5c0c84514ae44f7ed1a20ffc7788790cec4fa0eaa9e2f6051c5e1e4b50fa2345fc194543c387eaded215a120bfdeabb46c4560a07d6da2cae3a621a63b1aea8a8794f76ec3540636afb363fa874897cd2a9b4c94a0d0b2a668eee1f239a5a899ca8beebfa025e0dc30a216f2e33400ed695087a38ca042eaae8cf8e48b512e75cf0da31c5e182b50b99857464df474083e3409e1bdcaa0bc88c7c8682ec9e37c702030e3b9cd0c46c81d6eaeccf2e162151b27ad0881c8a04fcb74279d010acd29758524b5ca4171941843f4eefbdf7344626da7a85cb319a046657bb1d5fa61887bf4f5821106159c0bd4d5750cd57a4cb26fa1ee9851d5d3a0ceadb8b02842afd587a0c25a9eb5bd5e70e6b534363b22876ebdf9ce5d6e1294a04614e2bcbe7f3e81a1555fd467743bfa6b56490fc044e51988cdfcd5e5e48c26a04248138030e658d995e03f8e761bf0b9c4f696802cf10ab4cf748603acfa3c5c80",
                    "0xf90211a08480ca3f5828a50e914c3f5650ed135119770dd96608b180e6c01e1da5edda7da0ba9c688ed9993281213cedf64c40e9c5b44f84ec3a8efe4fc11805bf72b4b48ca03b301a0f54e524a0bde516ed59d2a7791632241deb932510b451c80e0a530bb1a0c4ba868a4e4e77419f7736bb6fa3bb08882bbea542a1355027e15046208febd4a09cc42a47ed2098b0d3c3d60d55a96929fa3a45d87ce7db2c6256da885883094ea044cb87e48720052c39e571ba49c215218e992a055367995e697bcc8cd198357ca0a3335f957a729c784c1c3e0d0441de297e1646e8327130f6b8f4faebda8d6661a07a1a15c9042a77c60343260527abb0b505dd22a75a297aaf4592a5c9212dd9b5a0512f96fe94dc1002d00544587d9e7f9350bddf82e2e04e2efc93962b6a5098c0a0afa1a682914c10ff3bd3e2be1bdbbe7abd1101b4c578f6cea17d11082ab47d96a040f7f4746637c037c11951950fbe78c9a5940d5d7c3fdb8a9e763098406c8306a0f8611d790b4dba7fae14fdee5dfd4b796341ffcf45e19ec0b954a231951338eca097acef1716dbac0cc06a114228acb06a34c564bf68b3d64bed408a57d1a512f4a0c7bcdd8021cb5e20abad7756478a2d4165ab8d848896e12ba65fefd8cb57289ca053ef83a57d7075888aa3bc2243e0e98d300c7eb79c912f003c87e9148ac99832a03ef7bf22576fa01b5a235342aeed4af839db4d4b398ef348700ba1a23ad8083e80",
                    "0xf8918080808080808080a031421d0233b71852aeeda8801c6ee14507d15ad6834edaad66d22bc328e6f96e8080a0e324715d1594b0a612614d95023ecc35f5eeb103ee858ffe6a58821ee6b2a243a0c335c3fa1dfd41ab91d6a3b40cd8bde670b81b277c456e2314507c495cda0faba063db626a21d6e87d5fdc8dd9b29f2157db7c32848b8207826dd7fb1a2aae40b1808080",
                    "0xf83d9f2093986a7b9e6294572ea6736696119c195c1a9f5eae642d3c5fcd44e49dea9c9b6b64d90000000000000c100000000000000c110000000000000c10"
                ]
            }
        }"#).unwrap();

        let ClientState::V1(client_state) = serde_json::from_str::<ClientState>(r#"{"v1":{"chain_id":"21000001","latest_height":175633,"l1_client_id":8,"l1_contract_address":"0xd318638594a5b17b50a1389b0c0580576226c0ae","frozen_height":"0","ibc_contract_address":"0x06a409cbed33caa9bf8181ef3aff2c504e1cfb95"}}"#).unwrap() else { panic!() };

        v1::verify_header(
            &client_state,
            &header,
            hex!("8fac75a71de3961ea66fe8de326346d4d8b4ec98a769639a65c61dc539b80d8b").into(),
        )
        .unwrap();
    }

    #[test]
    fn verify_header_v2_works() {
        let header = HeaderV2 {
            l1_height: Height::new(9451000),
            // cast proof -r $ETH_RC_URL 0x042B2E6C5E99d4c521bd49beeD5E99651D9B0Cf4 --block 9451000
            l1_account_proof: AccountProof {
                // | jq .storageHash
                storage_root: hex!("af11e554c388336c4cda6c14b21fc44b799375a6351ba96fd737497262ed2348").into(),
                // | jq .accountProof
                proof: serde_json::from_str(r#"[
                    "0xf90211a035b9fc5fc45383d1d290a249cf48bea9f45e8bf8d3ce223f42aa72148bd4835ba0cf14cb17cb94ad9f0b16ddcd7b1d12aeced36ee49d20da9bb14f8e0b371cc4fea08bb769386c748dce3ba20b8b13213fe7ff46182318ffafdb0862a96213f4bdb2a0008ae94de4dd2bf956bbf3e7568c3af0a3a5b8f8fdc3f047735ebe4dc664f7f5a025615fd26477f2286cb00350707889d22c9987ab28a8f06044b577034fc63ea6a05f6bc608a8c6d0b6f45580ce2512973bbb5374ae3c2e89e79579848d83b40324a085e14e565e8e77fb698643f476cf1bc4ef29dc1fb2547435cfedc44f853060a9a0af5ee6265ccdef9e04aeae08dee237a11a742bb0b58eb5d788eba20b8130c7d5a03fa97f4caae6c68537564c30ff3623691a38270c42af627f14e32b20cd1289b0a07aa884d4342940346ae4c936957a25db4477c10378a5354ec655d964908b065ca032e892cdefa6a65baf07dda0a0f0db1715cf5631f841ee3209ed4bf61b1d92e0a0ec7b92169c854ecacbbd63f9f36bf5c1a2e208260f0c3d30bbe73af50be1b381a05c0410ca0bf3c3bfee505424075198d7030d1edb47fdae89c7c0ddc739874a92a0cec4992e3f846bd227b57885c07b9c498a10c90aa0a6b776429b2d5707f81610a0f6d42ba761a721edc10babb983957d5bb6a2f401ed8bd1671d1687eddd16c319a0e92958283465c62c772288c5d4acbeeb4a755b43442390119adfd77728c31dfa80",
                    "0xf90211a040dc0576316f551c0ffb65ae332298304487053dd0d713ba46f346a56703b7eca03c3d0e3a48a26669f7a29860052955c2a6e399142408787b8d98a0b5297a26e3a0d78cbc829cbacd58144bcbc9f9126e2684f30df8b3baf49a54ef79333c401f30a0d4677babf8baff360d69acfecf73681864bf85bfa6b6c1e68f820e14a5b3ee95a04ffb43c95074867d6e762056d41397c005810aebd60f92f6f82c211ce3afb31fa048eb9a9c7c64dcffd6013f7dfca2d49866844ed12b16fe5d491b16d0d9053f7aa066184788e4e84e86a3157a4f0907d1787bc4abe91a6d3ec5f61a459104c5575da015480b58263ad87ddd56c454599c768a744f49ef58aec2b644bd3042cdee9efca0b4b6048b6d0b4d1d41f27395be96f28f540e291eeff5f43c7da396a801986d18a080c9a7d8ec1d66e10639ce187e8f1a23190979e61e04db9e0dfdbdb5943faf34a0cf5712f4819aceab4fcc9cad5a17d54534618eccaac00a1bcb7829d4a34c866da011b876e3dc9ab4f7471478924fe18156be90115ca816ff1a3be43f98b4390e01a06c81178f85a8e462e9278259ca58b61312de82eac763980fbc566b25ac939fc4a0f48a00a72ea4e16f382ddb65872e480b4f21a0cb9f9ad4d44e0c8dd01202fb80a069a03345e786736dde037ef4404fc3fca83799af1f155c536b48e4148393ba7ba0911a9bd6b37fbf558715d74e5f17fb9b6b6ed094bce6bbfbe49e6f83b3d23a7480",
                    "0xf90211a08ade772d49b9fd1dcc1f85f88403a9be2643f5164b973e11f57dbea18127901aa0efa3fea1998e9ff00073fec8dd850a9311fe5d41a41a1f6508d9d96e740d8c56a02dce335b042ac8017f9ce5babda74641b38517758c4420ec665c797c42e48869a0d5ae924ecf419fabe1b7ccea8ad176bd9a03c7aba716fef5121cf496dd241596a0f6c5062e55bfd9f44604fd754da32d4b899b71c1fa2c8f97b4e8dc167004289da010de59a1c695b4ef474dd3059165c157ba982c3c671c0f1ba0e338bf6c33a1d7a04faa0b05dd621d03004c0d2f504e863a1ad0080dc373c44693c84ae8aa966882a08da579f0342e436b74908bbe183783459fc18a2d12ef1afead12be24855165b4a092ad5c4e692d75b2851c5e0f54e18bae4091fa10f01c8146824da7094f2399faa03e5eb1bd53c2829e8254bf28e481002ebea6e58328e3804d35cc9794e13ebbf4a0ad2af28b620ff6ff86a1f83e646198ba49eddb0b9c7cc4d7e75b969521e6b300a000d51a41598feaea351128404e9c6fe6577115047eb8d9a60578d0993fea4071a06583d8c96c272e86d4277ab2d01d8d585786e7cd1d0667b286c9ee54373fac1aa02380b40324920d4007647cb9c36a6202004a11023b91864d27954d6c52e89727a0e62998f143749ea7d68def27972e1b69bd73c019a811d304a9ac960bda42fde0a0034cf3f09ecad1e5bab9d67042d5064ead9644800ca1eabab58f1b727e14884180",
                    "0xf90211a00ebe4a14174d4daef9cf115b74823c7f07f9c56e9b91877f90f6cbf3a81ede64a0b9bce1f3a39c9f00c65136a49e96f5e5167f2e2009a1ad4e61d3004cd363322da060f022c2e8ed3f8a3e8d04ac393f84082866e639958b87296ca93ae8f36107a8a0b0ee39d06058c62973e980d6b6b39a6016cfb9c378b812e8362420ab8df60d04a02140cf3a8de979d2a5218925a60a0a31420611e210e802d069f878f2782ec99ea0ceddacd91be61182fa2e207f78167ca29a01f0080fe124ad9c6adf847f46157ea02363c8b6d5075e887fe02d7dc128644c80e8fa959b24a15c3679ba681f1c9ed0a07c2177f1e8309b9b3d40f33c4957bb3347ca2ea6d48be1a4f25d08602bdc21d2a03aa63b5f5874cf0f3947199fd7a9971f2113492da6f94f0e5d6ad1afb6900032a0bcc4842a27f629216bb84c27e9cf28cb3b39d44aab9448a045474b72a0f94700a09970d2602978e006c34bc7200be4b64cb7ef35d83287d2a8e37d005aee92ac7fa0de64b8bf21f8ef68165765147a632e78ba1d8bc740e402b3aaa35cf8575e4556a0f52c8b3ab4fc4359f03505a3ca52e1653e5964029eafe619d243cd8f59b1363ca04f8ad270650d31b4d6976fdd7f5c14f889e88a7e802031172b0ba3d8d7348b82a0a5da07e9f68add348ec0edec44222909f77670f9bb70c19cbb161583f04cb4d1a07c12b9f02dc24fc33774727bbe29ea7b2c3bb689349e19722036fd979e9806d180",
                    "0xf90211a08a313b557a817c37974ea08b774f9b42f5dff86886ba4d381a1761aea1492d99a0f68bddbd8b27f9b66d7e2d32587c6cd1077255309a862b84e3d99c6cf654da0fa02e2d8a47dcf90cd94c597fd1252eea9e966b60f19f05130590a0c5726e308835a04045e8fcb44ce638292d35f6a7be9a050133ccd16b55d8a0352c56ae5d772399a06d11fe1791cd2a586227301c66af0252ebe880bc41b2ad19324e10af8f00ae32a017e5d36c650d37155852b3d5ee4794ed7c0627a1b2b9ca3f3d12f5a38b3d08d7a02fd683f50b2d727ba36b327cb9d07409bc60189e906e4491a47b58cbc93a9257a09421c85bbd4cb009c514a2b08f1415d44e2611c0572ea44d8bc712b5fdbb2345a0113e820689f2c2aa4793e002a3dd2be2f84d8c476fd4cc0f8107d7c414687008a0cd4a7cf5ab6594ce8bfeebff84c3360c8ff16c5e852070260ba06e2462ead94ba0c33c5693a4d1a1dceeb0d8af9ad96da8f985c3d6c0d0eeb64966346b839d49efa0404c388d7c6c375bb22976331c3ba0795a724675fa0a473cbe7b1c5fa5e3bd84a0c33b64d3458be256916ca6dd3c9593a5f57b1fff6f0cf7f2bd15a3bf5ff7140ea034d316f58b05f05846605147dd92672ece35b20aa745a9e619c64f6a9543ebaba08ae4a1fd644ac7c23ffb067c99215233c2133be8662c97cc578462e51ec17bcaa03b01a915a34d279045aa50323f663fb191ade1f35c0573dfdd02a3ad8ff17a4d80",
                    "0xf90211a096aa01a559b920e7981f5604d516d8cf8050572deeda06eca80cb4ad6d64dcbda04ddd230fb3dd2d011b722cc757cde475f751453f9476d2b7ab3d82595ec79f99a00e31baec08bcf34c94a91a055cf3826eee048e3b40f18b51f5adbf44a5fcf125a01c4f402a3a0597ae564934e6672c8e4e3fb95026d584bfe39b4626b4a24839bda0d847a08b8519fde63478f11783fd5f35643605830f131724ca41ba8e5f3194e6a080ec5976ae3dc4bb14499d17c5e3573a9cc417513fdd0d42043687ab45ff3f35a05397e0115a6973bf1369280cbc9cb45eed9aad770ac14e20775f7b24a39bbaa0a0883dca93aac444dd0484676271232d182e5ecc2c4701d10c84cc74368fe026ffa00bf321ba3e258ca13849a628c2ebc5defbe714172ffc670472288ed511d69f83a01d5fbef2caa97e7e8b81960f952ddefacce69dc9efa2c6c6764e19be5f2afee6a011269ba8a17665fa89cff5f087736372fae2200ba9bb923065f759a6b833f659a0084a1507420acab2842123a8fc54732394f4f81b96f741a0d389ab5f0218271ca04e0b5e5492213fcd9dde7f8915d7da062ef7aa02349a77f930f0f907e8784b7ca0b55805984300c456ef61d88f143c3e1ddf1c8d4bce17f8b2e288391bebbbb25fa03f5e90e2b3c45e56565cde14518003575ac2f4014759efa8291f84f63a8cfe3ca01db229e3381a0ee249bed5977bd85da16c483a0159b46aac9085631668cdc0c480",
                    "0xf8b18080a0723775c8e22c2340accb31cf58f5e8c77f18832e5faf6f6c8ec8c2656f0b16a380a081d43d45417be749d1ada483694d29f3d3bd2fe464a0889b1a345c47e2751c088080a01caf3c5cf6573899780801a48379e0308b4e4931932e46b131b2c589892c64938080808080a06a16d92e3c22e2ddadfc63bf24852c581d3a5e9c609d395e4a85e2f9da3c96dc80a036251b0af67c5fcc3b73539727ed8567a9aee142d6284b741408d0996d4ef17680",
                    "0xf8669d36fbeb2b885896e84b0c0908309bd7acd12b63a7c1c68f1649869443d2b846f8440180a0af11e554c388336c4cda6c14b21fc44b799375a6351ba96fd737497262ed2348a05961c8c303762fe3bdc69d0df28db034e475e46ef4e3582c632eaaa51314ce29"
                    ]"#).unwrap(),
            },
            // cast proof -r $ARB_RPC_URL 0x88952655581A0E97D8aBC4fD9a90415556699478 --block 206532974
            //                            ^ client_state.ibc_contract_address
            l2_ibc_account_proof: AccountProof {
                // | jq .storageHash
                storage_root: hex!("7d5b16c726d2e698d03a8c79756eb63c773e81b68aa460f3f1723114d5984262").into(),
                // | jq .accountProof
                proof: serde_json::from_str(r#"[
                    "0xf90211a06e3798ef2534b485b035508516fe1e329edd55f4f4a319f3ca6d3d434488ec04a02302acdd9002e957f87dbb122c77345a8208a15478ed6a669b9c197d447a51fda06c2bce095753713575e420fee1bbd8db076fab23c2ba617340ab6ecb21f7750da069dcfe7e039157bdab5972f5694a1c5a08edb6bc0c7c3b683b1edc485fbee750a056aa12c5dfa473626d89d6c51706c312239bf02f4f8da479b560b9d253a5fbf3a0842d7f58ea0bb770621ba02756f0c006b079a0df7367e1d7daa463d909cdb28fa0bc9934d4ae1fd9296c39f3d03a70406a9a7fb6d564ee3f0617067cc4427a4728a04b68cc9b126f60968a508a10fc0b262533ee2be8cd9b1d820179902188616230a0a681317fc28fca0693aaf6a41618ab5c3542718f7bada8dafe21679c42cb23b2a0169871cc47bd92ef7632980285c0cae63c8c44c84ff9a54d69fca18ddfe4574da04674d4662632faf00e38f1d32792efc1ad54720a892abb7cec1a76446f7b7d16a0e3bfedf348acbbce55b4d5cab031435956eb63318eaddb6efdca70062d7744dea0b562d31f0ca7ed19bd8642b12f917741912e37e33ba5c7db7272298b97991cf7a0eea1b5397c847ad887a6773c1ea899d9cae0b3d053bc34f9e8e9c3b8c4a40801a0fd75622e16aacb0b5504e8826adf362217340f708d0728f7b2dae847319e4577a0b5db64fdd0dc5acaacd9585247f878d278715e70a19701d71ffc7ee8cb16290480",
                    "0xf90211a0acbbe1d33bea2c601fb3ec1ce633c30ae1fc301f78e7ffbfc2cd2334b912da12a04ff72223f5eff25c0b1e5dd4d2228e61b8821394c74b9ce16b935aeafb91818da0c3c6abdf5f9fe109e4a098a442120b1521e52349c7cc5d6e81a0bf9374328e9aa0dd22e0e0cda48aa84ee49930bcf4e51a93be60fbf6611a5cf750e76cc4132b11a0cb88283e9a784667646f6dfb7a2ec61b624db90305a82a78ede532759b468d34a020a75aacf54b427b5104a7918fd4afe58e713735080b6d2eaa0b849753e79b65a0afeb34af18f00741dd0f2768aa5c856c0055666ba36b60544e2a959918924035a08e5982515b9c37d2cdeca527d303b79ffc2e176566ee17fe0d3ab563c6361dd0a0157f769e759be12d3ff1c13cd0a7654c5b5b62a63aa5333738e5a288ce592209a0a4b84798dee72eb05d1b1563a1cae1592f7a699e8538cccf3eec96c3f131f171a0c988ed2b3594cd3b8c4312f7ebd40886f75fc9d72751aca0c5f4f64229502c7ba0e3543fa5ab353a28bae3f8ba675ce73e6eb198b77ede61f71b46907c9f913757a0ff756647fd15da9963b722b3a64e7cec632b757ed6a78ded16c03db58f2f93afa00a34b5f526c35cfd41cfdb12dfc8c64f2c1e35148a75b924dbbe3dbace55a7e4a0b0511e36b3cf9c41ee462f121cd03385b2216cfcb33fbaa03c59ef81aee5fe27a0d6eb2a20ba9a850a23879ab4d540cd4a516f3ce4bfc1c6f66a0d95343570df3980",
                    "0xf90211a00027cc7ab72de50051b9f0b1d2bac5a468c4f14313b1f1e94c04f89cb1f83e0aa0bd32cb844f067d6d2d272a4fe2e4fcf3f6540a2111a5164fb1b54902c28fd5e4a0ea1b2c3207318ed43ff36e2b41af80bce9023af3be05c599c779889def23ff1ca0b8dd8ceb08aed3c2ba29da4b20c8ef2dd2c725e689c87ef043a4a9b3a5c5393ba05a70fad4486c66607c024920578e7efb8274ef01026b80891045bd49d3c3dabba06bfd45fe2aadbebc0063b82927ccf35d0b4a05af3fcecf8e669d313d9b22f91ea034002844c616828a24415ca6d3b3ce40fffe12e43b9e91d706548df1003954d5a06bbd7919364bd8f9c89e35b6d1ffa60cd1caae2d218b32ea6ddfbf963b0dc281a058187982338db68a4c13a680aebf24d153854f6355822fefb56bb8ff4380f123a0e4d3640af94ecef4e4dfd0874b7fff46007e4754519dd9f9f7f92a3fe7064ad4a02506ac7e8895b07bf209e7624502359eef6fa6658ce06fa190612f9dd27628f2a0059f0a4ae108ca33e5217ac5c0bd17290174d4a9cd31ab537efda00d1c911897a0dceb7c4b6882e896c63a99af752a5891faf67040d3bcccce33d486dc00bb6584a0b37990aab09483faea39e647d6d4debf3ac8fb5d4f65dd0d3d36491d6d9b0b0ba085ea9a217eed3a74fbd957a37d5fb86de370a0aec0b26d67e278ec896317ca22a022e1dd49fabede984d82b6b3a525600034f23e8148e481f1a61871b2d33d0dd180",
                    "0xf90211a0d6dc315b532053ceb998ffba8336fb1189f381c73b5049fe36474442b7b36c4ca05ad9ffc0beae0077e5047358cf7831b8849c09c42542056b2c27daa79e926a86a0526f776c6beed596cb6c129b67587b9c5ced2ae59c42b07689c04c99cf83d674a09b1776b89f15ea9e823c369788dd9e441c2e03df3787f15717025d5c662351f5a0965d6c0331307e0a47bfe3e01014fc9a27ee5c0bd58d2500c92faeb1cf5194b9a091a40bc25a2a4a18a3bba19af130bacfc2d2a3cdae61352ed2620dc67a594c0ca0b145a9063ea513686571b871dca025c593af6e54729e6abd114e7a4eead7e462a0721f3206fd92dfd57787ac295dfd2d63e810aeafae39f61af85ffdb5890c6519a0bce5ec108a6b690d8173876750a8e70c2fa77b3f08ecb55a53fb477229bebf9ea0ec9bb37525e5e4f9ed17c7efe16703e5769514eecaeaad06fcafd36629cca92aa0c391782325db6088aa5d598fce5e2decb41e73e9a2a205148f14fa485854022aa0d2e95f4fbbac10cfa96523b0a3fee354f25308a4f16844b1e81f5cc953fe45e8a06834015a5799974b656a240fa4e3375ef8e9b3677c4df417c44f58c0932c378da00a1649137039f9fb49e30b96d33d9bcf30082369c590bc6f81ffae9e7b529672a098d0db9bb46b540caba16c885cf029c8bc63a60cd2b368833050e116556ea215a0e689ed2a15b2e38e34ef1bfaed4edb9cd5e5feed77d37c5c0d65422c3b1f290880",
                    "0xf90211a022bfc86afc6407247f89fb6db7aa2915007769deac62f344901ecf40124aab1da071473a3ca0b5b2b13f53443b61b3bc5a005360f453f38e70580443bd8a1224d5a0a082934301ccfe1f089d0dff4e2d1a3b891c81e256dca5d29c5a4813aff010a5a02fef1886aaa37a15614c6d918f4e946b27224e38e21dda67a029908325fd6f70a0f2dd4e0ee4d16dbf831bbdc588832f1f7a5a3ab08be46004b372bcb9b62d0699a0f0075f85a40fda771dea2f725f7783e5ebf7898fb57b3f58d76f277576ae5a30a0538fecc653ae7aa49dd43e6f265a845ceb43ccf1bb9814326d62f6df92b5e181a02d126b061b0a56cb213e11872871b3b57c0e148edaccd9c8c3eac8e4459b8f53a0919de81f586accabfa7fd89adde75b3a10bbb30f108bd5fa97b75c40d5116cbfa04f955f90bda75e0b954a04559e0f72583837d120c52e4c5194403252dd25eaf2a05ddbbf24479b449c59b85d6c10c03467adbd1fa907d7f9d1f235623fb5843b80a0b4415e5c9b39cb4e1baa9961ccaac333f64111dbc89fa027d09077e790dc8c7fa02dcf3b570c649d937114d26feabf825fcde679299556fb6b53f2d7ab47701b5aa05ff14f19d987cdf3a15e11ec54c5e7a744e97bc2975183def5cf597956d7f4bca01d5e63b415eac85dd870ec650922cf52912d74cc855b034d6c6e4440796969f6a018f91611619709e5f8f20e3422b6380bfe7467e549ef959cf12a3630eef3c17080",
                    "0xf90211a03e489aceefce76263f182049bee2db18425e4c7bb4b9c275f5cc3e9f6d0063faa0bb0c4ee02f310f2b31e611192f3a095f8d1649ea54bc4dc128f0cb567f48f8d8a033ae54bd6c105af555f3b7ee74c59337b489ee1886a630cf6960f3a47ca78cd7a0a95577426159f4f6b7889e79e8fd5ad03b107bb0cdb8065c395be1d59ebf8ae3a0474a924585c3f4bb439b0cd70000f48d40fc9be95be2eb312c26893c92e0a74fa044962511d0a15844d7d4d1d8f75b0c7a711d8557bbb97ee553d81e25734e8b14a0a729151299dc55600166b5ad5e105f301c9fa2815d165320de9fbed9ac2bc14ba02c071b0ee62b5815a76acfb840e76275aaa9b2f549cd04880ed107b8c36b7230a079328a051bc668587e98eccea899851ed314c4670c52e340ea46ab408083f4c2a0ec8521e9bab726c6accd11e63303713159ba1c94c0b1d7ca0ff6dd4a50077db0a0b0f36c0541094c40d9b701b69f4300546879b531f8e5caa794cb0b97890236f6a0748dbb0a6047a97bc063b67fd2cba5639bf1dc3c30f38838e66d3d08e29d0a0fa0b64ae597bd4c5532b07dfef7771f1a8c896234b1b4a5a6a5a9a1630fed207f1fa0dbac61d1ee49a4442e4dd3312f5873957cc0d353ca765a7c534623c73412ca6fa0fbfdc69119c9bf09c15065dd3865fbb4706911b9d61f25637f72248c766f8c93a0e0a0faee02813e88d04df8161860978bc9a6502117afb1d77272df213a6561a180",
                    "0xf8f1a01f50450824d490e81173abeec10cc9ad18ad266212f92b2986d383837b0abca0a02c4eea12e5754a349cddc1dfb6b837093236efd010170329eaf8ed405dd681c880a0776bb90ef9a7474c1e1e3dd5225c35bdf09e5cbd73933ce19110fdece3ee3d42a002011c4f0140d2bd2beb6766eff87cf983d07f61ee182377d539ae787db70a538080a06a6cd25e600d335d612b67e291813dcebc1a60d70b86625043dcae874fe958cda0f343e2f747053fe01752c726d7230e86dd5ddfcf635cbdd8e223811a2c34ffb98080a04fa52b2dcc3f64df12db7be2db5385bf8e1612ddfe548db7f1ceef562cb68b458080808080",
                    "0xf8669d3c9a926f740976b9919221582d27bda344d5bc80c67375f6b941566790b846f8440180a07d5b16c726d2e698d03a8c79756eb63c773e81b68aa460f3f1723114d5984262a0f5f1a101a158bb4e943c42fe53f89c92eb1e001cb00d2704e2667a5f5c5c06a0"
                ]"#).unwrap(),
            },
            // u arb v2 assertion-created-event-at-l1-block-height --l1-rpc-url $ETH_RPC_URL --l1-contract-address 0x042B2E6C5E99d4c521bd49beeD5E99651D9B0Cf4 --l1-height 9451000 | jq .parentAssertionHash
            parent_assertion_hash: hex!("bffabdb2b9a2208a5bacc93bce5e17798f8d37989120331c8575cf8fa752c92d").into(),
            // u arb v2 assertion-created-event-at-l1-block-height --l1-rpc-url $ETH_RPC_URL --l1-contract-address 0x042B2E6C5E99d4c521bd49beeD5E99651D9B0Cf4 --l1-height 9451000 | jq .assertion.afterState
            assertion_state: serde_json::from_str(r#"{
                "global_state": {
                    "bytes32_vals":[
                        "0xf76035d011ec0e30beef0e5fcb1bf4d929b0aff4b89a378150ea830dc6b72905",
                        "0xf269dd4b3427fc3ed30964ec998130d0e767b652e41a1f91b1a05873e24931be"
                    ],
                    "u64_vals":[
                        607571,
                        0
                    ]
                },
                "machine_status":"finished",
                "end_history_root":"0xb1be9dac05f9ba7d19d9d72994ec6a7f22f863c05642546c45940b93471ba4e2"
            }"#).unwrap(),
            // u arb v2 assertion-created-event-at-l1-block-height --l1-rpc-url $ETH_RPC_URL --l1-contract-address 0x042B2E6C5E99d4c521bd49beeD5E99651D9B0Cf4 --l1-height 9451000 | jq .afterInboxBatchAcc
            inbox_acc: hex!("9f7055543da6851e919bdf636f3194f2fd5a2c926a243fd8df9d254ea6d18066").into(),
            // cast proof -r $ETH_RPC_URL 0x042B2E6C5E99d4c521bd49beeD5E99651D9B0Cf4 --block 9451000 $(u arb v2 assertions-slot $(u arb v2 assertion-created-event-at-l1-block-height --l1-rpc-url $ETH_RPC_URL --l1-contract-address 0x042B2E6C5E99d4c521bd49beeD5E99651D9B0Cf4 --l1-height 9451000 | jq .assertionHash -r)) | '.storageProof[0]' -c
            l1_assertions_proof: StorageProof {
                key: U256::from_be_hex("0xa7dfbbc6a1f7f6f67e6e4ddb56726c220c97bbe99cd6ea8b835da61751629c17").unwrap(),
                value: U256::from_be_hex("0x10100000000009035e600000000000000000000000000000000").unwrap(),
                proof: serde_json::from_str(r#"[
                    "0xf90211a08f4eeb517eb53329aed44b3304518a0c1ef99ea8d9849628eaae67a30d1c74b4a037e47140be1ce156fda198d482bed729b1e037e51fac7dfb6d84d3a439b60084a007486fbae7d607d712486f907f4998847d9aead46df8a7592610bac96babe5cca040bb31be24477ced3a47e2d0de923398ca31e2ccaada029b0ccf1f83dc0f3671a0ef37e2ffd6641b985c63ad3acf59779b49d7b922dda2ca0ddeec75b2259c4f1ea0f4f74361a90cf9a62afc10015b235be87fdaae6b7c3b6adf902161750c9f78f0a0b3a7236c22150232e603668e2869ee05e885310f16f821a322092bdc4b73404fa04d882c6f8f00de045a42c6ba1cc32a36217dab4842bc94eaf52bbe6c8ec1ef70a0bc00bce0345cfe3ff0cfa663b7c16661852fbc3a9a91421ddbeb964a9d158de1a0c0e914dc6e8d0ec7ae2d3aa2eaa41078ea56ab9fc6150d7bfc917bd83a7a3731a05c8127e412a4b2bd3c8b8f09457c4d78864a241e4371dd4159577211b1cd39c7a02b47a4cafc28f217ee2761b9e84b0d5691af76e1c8846a855f44c935054482e9a00ff53ba2dd86dc8a2474bab24da2593f64f37219f52c8b0f6091d2d46dc3e7c0a0e849013bbb50c65f72cbc4e94ff30edfdc023eac5b94c0bb321d4b520fa7cbb2a0dd8fcdaf8a6e685418df6b1b796c2cea9d008f3100e1f33dc6f9d683601b094aa09c16373d05617d360025a75b9a6277912f44ba8c8b103de74350f4e965abab1680",
                    "0xf90211a0356ac159b53f9e16ee3e6e66242d6951af0825f530f0915f15fd72972508b380a0d0629940cf3641ec19f0ea58d8c16d8be98cb0507e52ec95673c94a50aa309c6a0bc58ca2ac52fc71441e576223c808a691777c52010753c99320eb3c800dbc1cda09fc9cda7dd35082965b1c9bc2cc1b8af6f358dec53c0486c3af0a8a6f83f06faa002b17880b11fc1dd918ed9c5bedeb5cbe0cc66049212fd5fe2f9818cd1d8350fa055e8d379a6c8bda0c2824186ce08031843f3615ebade66c7f5b6a49f97eb7d08a0e240d7165d09f25e2aee9008e839ccbf3ee8d941a0ae27fbcd9669a55b8afba1a0719dafea8ed1324ed0052a260e0dc8edf327156db1be7306a5dbf3da9004d97da0dc017b0060fe8d99b362c0656c66d1ee8f391973d81b158f2e5467ec33f0739fa0496a185f56b45ed72600e487a1486a70fc6b338260cbeee6789ae534002b6ee4a0ef4df877a25fe184b197fcff257c5d45ec7bf77c3926861eeecd29e327f78413a030041560a267c1df617b15f533b55aa48fc55c2afd3e61d993ebd2f45f7ad17da09d62c1657c8703de4de456ba385a183dddd495d4a3786c522b9645b4cfd00010a06c2343e2c09b84ad99a33dbefc236453d64c9389f347590b4c3b3ae2a7f76b80a00333ddd9e2eafb15febb6b366fde5127545e7dea423b7842ac15111dec9def65a0ec058f177de73beb2e803cb47af48c07366bfedff556da045e6f113b9da301ab80",
                    "0xf90211a004e14598a0c4c6143bacb70342d545b759c9c4f2fe602d7e1df780d10bff7181a04a37839903b229dcb4873d0d43d7868826a75a87782c6932a23afb2b65719d46a071eb67545dc6225c9a14a81afdc1612550decdf01eb3600eb4cb4010cefad001a048829b108017413a01b9777b7fc1eb37c205013468a26bac71bed2ea32fb56bda0be8008b179c97a8293412f8b762d6cd831d957589962c274cedc349c0d469b2da0f5abbf13367f59083881e8009c8114676c2d388fdbb74eed303a383d180ef94fa0e3e1b7136660257145620cd58e150cd35ab9be2c0befdc9622c03d6a38c2f823a04b43653cea4e547b2986ba55e04ba418220e59570bbb6ae7098a2c951f700088a072fe279c3e1b6362e890f67334a02070b3bf6810c177a0ecd2c16e5255e48aeca038e6559515a5994290529fd8c084098325f549bb9c1febeeccfca901d7001d5ea037b3c5d3e207a6aeace56b9d773c37baef871456722541f3741bd5cf9fc023a2a0a7544389946637d6f728d8234524324c5b8747ae300e13e21f551060c1a2e1ada033bc05f142d82ee54b37f6328e8a23935a6439773dae12d880cb5b94fc7cee3fa0fd43dc296e6cd108fea047b4c1df860526e9eded9ce61038042db81ac2a1ee1ca0f8ce9aa32420f90acaca70f4fb4a24ae80a0dff2c053722d9756bcbc8e9404d8a0e6938f6d2f664f8e7895da2ee315a95ab26fc484635dcabe31027b836f2e156080",
                    "0xf8b180808080a0d2b78bb65dc4e03cb183b240db4e3eb91bebdbd89e39e710ac198ab7fa4e839e80a014a0aed0b2bedc04a4b1695667f6b9c58b28c68ebea0d25a98b510609820bcda80a0f57ccbe3dcff0ecd5f455d5c237f9db0589882ab868171936f46ba48f99236faa0c9e71917d0343aa2f30ab8d9bf81688dfa501a97eb18a934f335b2255526ccfa808080a0577af4d24d6df94f576d23e476e175217a7dad13e24a70a98c5efe8eb07b7056808080",
                    "0xf83c9f208f311cbb2b8bc0b9d28a120e44af8d6c8c7321b779b4c1676622c55f2ba39b9a010100000000009035e600000000000000000000000000000000"
                ]"#).unwrap(),
            },
            // u arb v2 finalized-l2-block-of-l1-height --l1-rpc-url $ETH_RPC_URL --l1-contract-address 0x042B2E6C5E99d4c521bd49beeD5E99651D9B0Cf4 --l1-height 9451000 --l2-rpc-url $ARB_RPC_URL | jq
            l2_header: serde_json::from_str(r#"{
                "hash":"0xf76035d011ec0e30beef0e5fcb1bf4d929b0aff4b89a378150ea830dc6b72905",
                "parent_hash":"0x34860b29178c150ab27deee5c90b5eff337238aefec6464feb77ba26c72bcfe1",
                "sha3_uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
                "miner":"0xa4b000000000000000000073657175656e636572",
                "state_root":"0xc667cda6ef22f98c813269a073dc3e1f752f4a49cf4bf4266f00b5aa038762f5",
                "transactions_root":"0xabce67faf21ea890dec82571594c150675c90644c636dd5a3fdfe1ac8ae5de65",
                "receipts_root":"0xf4349e2dac154c4b0a978402486937d7633848da7d8b2ed91a0e6cd71538e5ca",
                "logs_bloom":"0x00000001000000000000000000002004000000000000010000000000008000000000080000000000000000000000000000000000000000000040000000000000000000000000000200000408000000000000000000000000000000000040400000000000000000000000000000800000000000000000000000400010000000000000000000000000000000001000000000000002001000000000000000000000000800010000000000000000000000000000000000000000000000000000000000000002000000400000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000004000",
                "difficulty":"0x1",
                "number":"0xc4f716e",
                "gas_limit":"0x4000000000000",
                "gas_used":"0x54295",
                "timestamp":"0x68f5e710",
                "extra_data":"0xf269dd4b3427fc3ed30964ec998130d0e767b652e41a1f91b1a05873e24931be",
                "mix_hash":"0x000000000001b4ad000000000090355600000000000000280000000000000000",
                "nonce":"0x00000000001c718f",
                "base_fee_per_gas":"0x5f5e100"
            }"#).unwrap(),
        };

        let client_state = ClientStateV2 {
            chain_id: 421614_u64.into(),
            latest_height: 1,
            l1_client_id: ClientId!(1),
            l1_contract_address: hex!("042B2E6C5E99d4c521bd49beeD5E99651D9B0Cf4").into(),
            frozen_height: Height::new(0),
            // random deployed contract address since the ibc handler isn't deployed at the time of writing this
            ibc_contract_address: hex!("88952655581A0E97D8aBC4fD9a90415556699478").into(),
        };

        v2::verify_header(
            &client_state,
            &header,
            // cast block -r $ETH_RPC_URL 9451000 --field stateRoot
            hex!("3c066db52a004b48933e88ccfb22cf363577fa86c7effcd2bc48f784be11e257").into(),
        )
        .unwrap();
    }
}
